home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / cbibcode.arc / _CHMOD.C next >
Encoding:
C/C++ Source or Header  |  1991-08-05  |  495 b   |  19 lines

  1. /* _chmod.c --- p 573 */
  2. #include <stdio.h>
  3. #include <io.h>
  4. #include <dos.h>
  5. main()
  6. {
  7.     char filename[80], *p_fname;
  8.     printf("Enter name of file to hide: ");
  9.     p_fname = gets(filename);
  10.             /* If you want to make a hidden file visible again,
  11.              * simply change the last argument in the call to
  12.              * _chmod to 0 */
  13.      if (_chmod(p_fname, 1, FA_HIDDEN) == -1)
  14.      {
  15.         printf("Error in _chmod call!\n");
  16.         exit(0);
  17.      }
  18.      printf("%s is now hidden. Try DIR to verify. \n", filename);
  19. }